package com.action.worksheet;
import com.db.worksheet.*;


import java.util.*;
import com.db.user.*;
import com.opensymphony.xwork2.ActionContext;
public class InsertAction {
	
	private int sabun;
	private WorkSheetDAO sheetDAO;
	private WorkSheetVO vo=new WorkSheetVO();
	private int writer;
	private String subject;
	private String content;
	private int depttype;
	
	public void setWriter(int writer) {
		this.writer = writer;
	}


	public void setSubject(String subject) {
		this.subject = subject;
	}


	public void setContent(String content) {
		this.content = content;
	}


	public void setDepttype(int depttype) {
		this.depttype = depttype;
	}


	public WorkSheetVO getVo() {
		return vo;
	}


	public void setVo(WorkSheetVO vo) {
		this.vo = vo;
	}


	public void setSheetDAO(WorkSheetDAO sheetDAO) {
		this.sheetDAO = sheetDAO;
	}
	

	public void setSabun(int sabun) {
		this.sabun = sabun;
	}
	
	public String deptname() throws Exception{
		vo.setDname(sheetDAO.deptname(sabun));
		vo.setName(sheetDAO.name(sabun));
		return "success";
	}
	
	public String finish()throws Exception
	{
		System.out.println(writer);
		vo.setWriter(writer);
		vo.setSubject(subject);
		vo.setContent(content);
		vo.setDepttype(depttype);
		System.out.println(vo.toString());
		sheetDAO.insertsheet(vo);
		return "success";
	}
}
